//package com.github.binarywang.demo.wx.mp;
//
//import java.util.List;
//
//import org.springframework.boot.ApplicationArguments;
//import org.springframework.boot.ApplicationRunner;
//import org.springframework.core.annotation.Order;
//import org.springframework.stereotype.Component;
//
//import com.github.binarywang.demo.wx.mp.config.WxMpConfiguration;
//
//import me.chanjar.weixin.common.error.WxErrorException;
//import me.chanjar.weixin.mp.api.WxMpService;
//import me.chanjar.weixin.mp.bean.kefu.WxMpKefuMessage;
//import me.chanjar.weixin.mp.bean.result.WxMpUser;
//import me.chanjar.weixin.mp.bean.result.WxMpUserList;
//
///**
// * 系统启动执行
// */
//@Component // 被spring容器管理
//@Order(1) // 如果多个自定义ApplicationRunner，用来标明执行顺序
//public class SystemStartRunner implements ApplicationRunner {
//	@Override
//	public void run(ApplicationArguments applicationArguments) throws Exception {
//
//		WxMpService mpService = WxMpConfiguration.getMpServices().get("wx7a917b3b518e0deb");
//		WxMpUserList wxMpUserList = mpService.getUserService().userList(null);
//		List<String> openids = wxMpUserList.getOpenids();
//		for (String openid : openids) {
//			System.out.println("关注:"+openid);
//			try {
//				//
////        		if("oe_JntwiUmBio_kapVlLd_7jOWCY".equals(openid)) {//陈文希
////				if ("oe_Jnt9LU-foZUsjfKaTb0Ft4YmQ".equals(openid)) {// 圆脸东
//				WxMpUser userInfo = mpService.getUserService().userInfo(openid);
//				if("Ben".equals(userInfo.getNickname())) {
//					
//					System.out.println("用户:" + userInfo);
//					return;
//				}
//
//			} catch (WxErrorException e) {
//				// TODO Auto-generated catch block
//				e.printStackTrace();
//			}	
//		}
//		
//
////        WxMpKefuMessage msg = WxMpKefuMessage.TEXT().toUser("oe_Jnt9LU-foZUsjfKaTb0Ft4YmQ").content("测试信息").build();
//////        
////        boolean sendKefuMessage = mpService.getKefuService().sendKefuMessage(msg);
////        System.out.println("发送:"+sendKefuMessage);
////        List<WxMpUser> userInfoList = mpService.getUserService().userInfoList(wxMpUserList.getOpenids());
////        userInfoList.forEach(user->{
////        	System.out.println("用户:"+user);
////        });
//	}
//}